Skip to content

chore: Restructure some more grpc services.#5260

Merged
prmukherj merged 13 commits into
mainfrom
maint/refactor_some_more_grpc_services
Jul 17, 2026
Merged

chore: Restructure some more grpc services.#5260
prmukherj merged 13 commits into
mainfrom
maint/refactor_some_more_grpc_services

Conversation

@prmukherj

@prmukherj prmukherj commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Context

The grpc service layer and python implementation layers were closely couple together for the grpc services.

Change Summary

Cleanly segregate the grpc service layer and python implementation layer for 5 grpc services.
Implemented a factory layer which takes care of version checking logic, etc.

Impact

Users to see a cleaner and well documented interface.


  • Design:

_grpc_services


- solution_variable_service_v0.py / solution_variable_service.py
- events_service_v0.py / events_service.py
- monitor_service_v0.py / monitor_service.py
- transcript_service_v0.py / transcript_service.py
- text_interface_service_v0.py / text_interface_service.py

services


- solution_variables (abstract_solution_variables)
	- SolutionVariableInfo (solution_variables_service / solution_variables_service_v0)
	- SolutionVariableData (solution_variables_service / solution_variables_service_v0)

- events (abstract_events)
	- Events (events_service)
	- EventsV261 (events_service_v0)
	- EventsV251 (events_service_v0)

- monitors (abstract_monitors)
	- Monitor (monitor_service / monitor_service_v0)

- transcript 
	- Transcript (transcript_service / transcript_service_v0)

- text_interface (abstract_text_interface)
	- TextInterface (text_interface_service / text_interface_service_v0)
  • The Factory layer in _grpc_services handles all version checking, etc.

From FluentConnection or session layer:


    _service_factory.solution_variables
_service_factory.event
    _service_factory.monitor
    _service_factory.transcript
    _service_factory.text_interface

@github-actions github-actions Bot added the maintenance General maintenance of the repo (libraries, cicd, etc) label Jul 15, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@prmukherj prmukherj changed the title maint: Refactor some more grpc services. chore: Refactor some more grpc services. Jul 15, 2026
@github-actions github-actions Bot added the enhancement Improve any current implemented feature label Jul 15, 2026
pyansys-ci-bot and others added 7 commits July 15, 2026 03:44
## Context
What was the situation or problem before this change?

## Change Summary
What changes were made?

## Rationale
Why was this approach taken?

## Impact
What parts of the system or workflows are affected?

---------

Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
## Context
What was the situation or problem before this change?

## Change Summary
What changes were made?

## Rationale
Why was this approach taken?

## Impact
What parts of the system or workflows are affected?

---------

Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
## Context
What was the situation or problem before this change?

## Change Summary
What changes were made?

## Rationale
Why was this approach taken?

## Impact
What parts of the system or workflows are affected?

---------

Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
@prmukherj prmukherj changed the title chore: Refactor some more grpc services. chore: Restructure some more grpc services. Jul 17, 2026
pyansys-ci-bot and others added 2 commits July 17, 2026 03:38
## Context
What was the situation or problem before this change?

## Change Summary
What changes were made?

## Rationale
Why was this approach taken?

## Impact
What parts of the system or workflows are affected?

---------

Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
@github-actions github-actions Bot added the documentation Documentation related (improving, adding, etc) label Jul 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restructures the Fluent gRPC service integration by separating low-level gRPC stub wrappers (_grpc_services) from higher-level Python service wrappers (services), and routing construction/version-selection through a factory layer.

Changes:

  • Introduces high-level wrapper classes for events, transcript, monitors, text interface, and solution variables, created via ServiceFactory.
  • Adds/expands _grpc_services modules for the corresponding raw gRPC stub implementations (v0/v1), and removes older v1-specific service modules.
  • Updates session wiring and tests/docs to use the new service entry points (e.g., services.text_interface, removal of svar_* deprecated accessors).

Reviewed changes

Copilot reviewed 46 out of 46 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/test_tui_api.py Updates TUIMenu import to new services.text_interface module.
tests/test_solution_variables.py Removes assertions relying on deprecated solver.svar_* accessors.
tests/test_settings_api.py Removes a version-specific comment from the test.
tests/test_session.py Adjusts deprecation-related expectations for dir() and deprecated attributes.
tests/test_codegen.py Updates codegen expected import path for TUI classes.
src/ansys/fluent/core/streaming_services/events_streaming.py Routes pause/resume/unregister operations via injected events service object.
src/ansys/fluent/core/session.py Switches session service construction to use fluent_connection._service_factory.
src/ansys/fluent/core/session_solver.py Uses ServiceFactory for solution-variable and monitor services; removes deprecated svar_* properties.
src/ansys/fluent/core/session_shared.py Updates TUIMenu import path to services.text_interface.
src/ansys/fluent/core/services/transcript.py Replaces gRPC-stub implementation with a high-level wrapper delegating to a provided service.
src/ansys/fluent/core/services/text_interface.py Introduces TextInterface wrapper delegating to a service implementing the abstract interface; updates PyMenu to call new helpers.
src/ansys/fluent/core/services/solution_variables.py Refactors solution variables to depend on abstract interfaces and delegate gRPC-specific details to services.
src/ansys/fluent/core/services/solution_variables_v1.py Removes legacy v1-specific solution variables implementation module.
src/ansys/fluent/core/services/object_model.py Updates module docstring to reflect high-level wrapper role.
src/ansys/fluent/core/services/monitors.py Adds high-level Monitor wrapper delegating to a provided service.
src/ansys/fluent/core/services/events.py Adds high-level Events wrappers (and version-specific variants) delegating to underlying services.
src/ansys/fluent/core/services/datamodel_tui_v1.py Removes legacy v1-specific TUI module.
src/ansys/fluent/core/services/batch_ops.py Refactors BatchOps to delegate op metadata/execute to the underlying service instead of local proto introspection/parsing.
src/ansys/fluent/core/services/application_runtime.py Adjusts solution-event handling logic for registering pause callbacks.
src/ansys/fluent/core/services/api_upgrade.py Updates advisor to use FluentVersion and adds scheme-based journal support for older versions.
src/ansys/fluent/core/services/abstract_text_interface.py Adds abstract interface for text interface services.
src/ansys/fluent/core/services/abstract_solution_variables.py Adds abstract interfaces for solution variable info/data and returned data container.
src/ansys/fluent/core/services/abstract_monitors.py Replaces prior content with an abstract monitor interface.
src/ansys/fluent/core/services/abstract_field_data.py Fixes module docstring to reflect field-data abstraction.
src/ansys/fluent/core/services/abstract_events.py Adds abstract interface for events services.
src/ansys/fluent/core/services/init.py Introduces high-level ServiceFactory mapping Fluent versions to appropriate service wrappers.
src/ansys/fluent/core/data_model_cache.py Broadens exception handling when loading generated code (ImportError/FileNotFoundError).
src/ansys/fluent/core/codegen/tuigen.py Updates generated import strings to use services.text_interface.
src/ansys/fluent/core/_grpc_services/transcript_service.py Adds v1 transcript gRPC stub wrapper.
src/ansys/fluent/core/_grpc_services/transcript_service_v0.py Adds v0 transcript gRPC stub wrapper.
src/ansys/fluent/core/_grpc_services/text_interface_service.py Adds v1 text interface gRPC stub wrapper.
src/ansys/fluent/core/_grpc_services/text_interface_service_v0.py Adds v0 text interface gRPC stub wrapper.
src/ansys/fluent/core/_grpc_services/solution_variable_service.py Adds v1 solution variable gRPC stub wrapper and associated parsing/helpers.
src/ansys/fluent/core/_grpc_services/solution_variable_service_v0.py Adds v0 solution variable gRPC stub wrapper and associated parsing/helpers.
src/ansys/fluent/core/_grpc_services/monitor_service.py Refactors/implements v1 monitor gRPC stub wrapper.
src/ansys/fluent/core/_grpc_services/monitor_service_v0.py Refactors/implements v0 monitor gRPC stub wrapper.
src/ansys/fluent/core/_grpc_services/events_service.py Refactors/implements v1 events gRPC stub wrapper with pause/resume registration.
src/ansys/fluent/core/_grpc_services/events_service_v0.py Adds v0 events gRPC stub wrapper.
src/ansys/fluent/core/_grpc_services/batch_ops_service_v0.py Adds v0 batch ops gRPC stub wrapper with op-metadata discovery and response parsing.
src/ansys/fluent/core/_grpc_services/init.py Extends GRPCServiceFactory to expose new stubs (events, transcript, text_interface, monitor, solution_variable, batch_ops).
doc/source/user_guide/legacy/tui.rst Updates documented TUIMenu base class import path.
doc/changelog.d/5265.maintenance.md Adds maintenance changelog entry for solution variables.
doc/changelog.d/5264.maintenance.md Adds maintenance changelog entry for monitors.
doc/changelog.d/5262.maintenance.md Adds maintenance changelog entry for Batch Ops refactor.
doc/changelog.d/5260.maintenance.md Adds maintenance changelog entry for grpc service restructure.
doc/api_rstgen.py Updates API docs generation list to use text_interface instead of datamodel_tui.
Comments suppressed due to low confidence (1)

src/ansys/fluent/core/services/abstract_monitors.py:30

  • AbstractMonitor docstring says "health check", which is unrelated to monitors and can confuse users of the abstraction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ansys/fluent/core/services/api_upgrade.py
Comment thread src/ansys/fluent/core/services/api_upgrade.py
Comment thread src/ansys/fluent/core/services/abstract_solution_variables.py Outdated
Comment thread src/ansys/fluent/core/_grpc_services/text_interface_service.py Outdated
Comment thread src/ansys/fluent/core/_grpc_services/text_interface_service.py Outdated
Comment thread src/ansys/fluent/core/_grpc_services/text_interface_service_v0.py Outdated
Comment thread src/ansys/fluent/core/_grpc_services/text_interface_service_v0.py Outdated
Comment thread doc/changelog.d/5265.maintenance.md
@prmukherj
prmukherj merged commit 4deacce into main Jul 17, 2026
56 of 63 checks passed
@prmukherj
prmukherj deleted the maint/refactor_some_more_grpc_services branch July 17, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation related (improving, adding, etc) enhancement Improve any current implemented feature maintenance General maintenance of the repo (libraries, cicd, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants